{%  extends "../public/base.html"  %}

{%  block concent  %}
<div class="tpl-content-wrapper">

    <div class="container-fluid am-cf">
        <div class="row">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                <div class="page-header-heading">
                    <span class="am-icon-home page-header-heading-icon"></span> 
                    商品列表 

                </div>
            </div>
           
        </div>

    </div>

    <div class="row-content am-cf">

        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">商品列表</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <form action="" method=""> 

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-3 col-md-offset-6" style="float: right;">
                        <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                            <input name="keywords" type="text" class="am-form-field" value="{{ request.GET.keywords }}">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"></button>
                            </span>
                        </div>
                    </div>
                    
                </form>
                <div class="widget-body am-fr">
                    <table class="am-table am-table-bordered am-table-radius am-table-striped">
                      <thead>
                        <tr>
                            <th>商品图片</th>

                            <th>商品名称</th>
                            <th>所属分类</th>
                            <th>商品价格</th>
                            <th>商品库存</th>
                            <th>商品状态</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                      </thead>
                      <tbody>
                      {% for v in goods %}
                        <tr class="">
                          <td><img src="/static/public/img/{{ v.pic }}" class="tpl-table-line-img" alt=""></td>

                          <td class="am-text-middle">{{ v.title }}</td>
                          <td class="am-text-middle">{{ v.typeid.name }}</td>
                          <td class="am-text-middle">{{ v.price }}</td>
                          <td class="am-text-middle">{{ v.storage }}</td>
                          <td class="am-text-middle">
                              {% if v.status == 1 %}
                                  新品
                              {% elif v.status == 2 %}
                                  热销
                              {% else %}
                                  已下架
                              {% endif %}
                          </td>
                          <td class="am-text-middle">{{ v.addtime }}</td>
                          
                          <td class="am-text-middle">
                              <div class="tpl-table-black-operation">
                                  <a href="{% url 'goodsedit' v.id %}">
                                      <i class="am-icon-pencil"></i>编辑
                                  </a>
                                  <a href="{% url 'goodsdel' v.id %}" class="tpl-table-black-operation-del">
                                      <i class="am-icon-trash"></i>删除</a>
                              </div>
                          </td>
                      </tr>
                    {% endfor %}
                    </tbody>
                    </table>
                    
                </div>
                <div class="am-u-lg-12 am-cf">
                    <div class="am-fr">
                        <ul class="am-pagination tpl-pagination">
                        
                            {% load pagetag %}
                            {% PageShow goods.paginator.num_pages request %}
                        </ul>
                    </div>
                </div>
            </div>
        </div>   

    </div>
</div>     

{%  endblock  %}